package com.jj.aspect;

import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class DemoAspect01 {



    @Before("execution(* com.jj.service.DemoService01.demo(String)) && args(str)")
    public void beforeAddUser(String str) {

        System.out.println("前序处理: " + str);
        str = str+"前";
    }

    @AfterReturning("execution(* com.jj.service.DemoService01.demo(String)) && args(str)")
    public void afterAddUser(String str) {

        System.out.println("后续处理: " + str);
        str = str+"后";
    }
}
